{% extends "base.html" %}
{% load add_field_css static debate_tags i18n %}

{% block head-title %}<span class="emoji">🏫</span> {% trans "Add Institutions" context "page title" %}
{% blocktrans trimmed with step=wizard.steps.step1 count=wizard.steps.count %}(Step {{ step }} of {{ count }}){% endblocktrans %}{% endblock %}
{% block page-title %}{% trans "Add Institutions" context "page title" %}{% endblock %}

{% block content %}

<form id="addInstitutions" action="." method="POST">

  {% csrf_token %}
  {{ wizard.management_form }}
  {{ wizard.form.management_form }}

  <div class="mb-3">
    <button type="submit" class="btn btn-outline-primary" name="wizard_goto_step" value="{{ wizard.steps.prev }}"><i data-feather="chevron-left"></i>{% trans "Previous Step" %}</button>
  </div>

  <div class="row">
    <div class="col">

      <div class="card mt-3">

        <div class="list-group list-group-flush">
          {% if wizard.form.non_form_errors %}
            {% include "components/form-errors.html" with errors=wizard.form.non_form_errors %}
          {% endif %}
        </div>

        {% for form in wizard.form %}{# actually a formset #}

          {% include "components/form-main.html" with double=True %}

        {% endfor %}

        {% trans "Save All Institutions" as title %}
        {% include "components/form-submit.html" %}

      </div>
    </div>
  </div>

</form>

{% endblock content %}
